package study.sharding.shardingjdbc.mapper.user;

import org.apache.shardingsphere.transaction.annotation.ShardingTransactionType;
import org.apache.shardingsphere.transaction.core.TransactionType;

import java.util.List;

public interface UserBaseMapper {

    int insert(UserBaseEO ubEO);

    int update(UserBaseEO ubEO);

    int delete(Long ubId);

    UserBaseEO get(Long ubId);

    // =
    UserBaseEO getByUserId(Long userId);

    // in
    List<UserBaseEO> getByUserIds(List<Long> userIdLt);

    // between/and
    List<UserBaseEO> getByBetween(Long start, Long end);

    // >
    List<UserBaseEO> getByGreater(Long minUserId, Long maxUserId);

    @ShardingTransactionType(TransactionType.XA)
    UserBaseEO getByLoginPwd(String loginPwd);
}
